chore: setup test (unit, e2e)#41
Merged
Merged
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Adds vitest unit harness in `package/` and a playwright e2e harness driving an `examples/tanstack-start/` app with client-only, SSR, and SSR-debug routes. The harness exists to validate TanStack Virtual's SSR behavior under our Masonry component before RFC-0002 implementation. Verified empirically: - `useWindowVirtualizer` is SSR-safe (no crash, all DOM access guarded) - `getVirtualItems()` returns `[]` server-side (no rect) - `measurementsCache` (public field) is populated as a side effect of `getVirtualItems()` even on the server, exposing the lane-assignment output without DOM - `getMeasurements()` itself is `private` in TanStack's d.ts — public workaround documented in the SSR debug route Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Brings the example closer to the official `start-basic` shape from TanStack Router so it reads as an idiomatic Start app rather than a bespoke harness: - Drop `@tanstack/router-plugin` dep — covered by `tanstackStart` plugin - Move port config from `--port` CLI flags into `vite.config.ts` - Pass `srcDirectory: 'src'` to `tanstackStart` (matches official) - Simplify build script to `vite build && tsc -p tsconfig.typecheck.json` - Keep `tsr generate` only in standalone `check-types` (still required for the monorepo's turbo-driven typecheck path) Also strips planning-doc references from test names, comments, and route copy so the harness reads on its own merits. Renames `ssr-hypothesis.spec.ts` → `virtualizer-ssr.spec.ts` for the same reason. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds a CI workflow that runs on every PR and on pushes to main: - `lint` — oxlint - `check-types` — turbo-driven tsc across workspaces - `test` — vitest unit suite in `package/` - `e2e` — playwright suite against the tanstack-start example, with Playwright browser caching keyed by `pnpm-lock.yaml` E2E uploads the playwright-report as an artifact on every run for post-mortem analysis. Concurrency is grouped by ref so PR pushes cancel in-flight runs while main commits do not. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Vite 7 resolves SSR builds with a separate condition list that does not inherit from `resolve.conditions` by default. Anywhere we rely on the workspace `customConditions` to read sibling packages from source, the SSR resolver must be configured the same way or it falls back to `import` and demands a built `dist/`. Updates two configs that prerender or run on the server: - `docs/vocs.config.ts`: dev-mode-only mirror of the existing client conditions, matching vocs's existing dev/prod split (prod still uses the published `dist/` of workspace packages, as before). - `examples/tanstack-start/vite.config.ts`: always-on, both client and ssr resolve from source. The example exists to validate SSR layout patterns; testing the lib's published shape is a separate concern covered by the package's own build pipeline. `demo` (SPA, no SSR) and `package`'s vitest config (no SSR) need no change. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.